struct ParkingSystem {
    park: Vec<i32>,
}

impl ParkingSystem {

    fn new(big: i32, medium: i32, small: i32) -> Self {
        ParkingSystem { park: vec![0, big, medium, small] }
    }

    fn add_car(&mut self, car_type: i32) -> bool {
        self.park[car_type as usize] -= 1;
        self.park[car_type as usize] >= 0
    }
}


// struct ParkingSystem([i16;4]);
//
//
// /**
//  * `&self` means the method takes an immutable reference.
//  * If you need a mutable reference, change it to `&mut self` instead.
//  */
// impl ParkingSystem {
//     #[inline(always)]
//     fn new(big: i32, medium: i32, small: i32) -> Self {
//         Self([0,big as i16, medium as i16, small as i16])
//     }
//     #[inline(always)]
//     fn add_car(&mut self, car_type: i32) -> bool {
//         unsafe{let mut x=self.0.get_unchecked_mut(car_type as usize);
//             *x-=1;
//             *x>=0}
//     }
// }

// /**
//  * Your ParkingSystem object will be instantiated and called as such:
//  * let obj = ParkingSystem::new(big, medium, small);
//  * let ret_1: bool = obj.add_car(carType);
//  */